]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: defer startup until we know our session mode
authorRay Strode <rstrode@redhat.com>
Mon, 18 Feb 2013 04:02:52 +0000 (23:02 -0500)
committerRay Strode <rstrode@redhat.com>
Mon, 18 Feb 2013 20:37:44 +0000 (15:37 -0500)
commit 92083eaf76fc7a5c2ecdd182896583ab5026ddf0 made
session mode loading an asynchronous operation.

Aspects of the session mode aren't known immediately at
start up. For instance, sessionMode.isGreeter returns
false for greeter sessions until the asynchronous
operation completes.

This commit defers start up processing until the session
mode is fully known.

https://bugzilla.gnome.org/show_bug.cgi?id=682429

js/ui/main.js

index 68cd4499aaae52b3c214645426578adbb5bb3a1b..d7ba21339fdfb42343654bfe7c7c33e90cc8d551 100644 (file)
@@ -96,6 +96,15 @@ function start() {
     Gio.DesktopAppInfo.set_desktop_env('GNOME');
 
     sessionMode = new SessionMode.SessionMode();
+
+    // start session after we know what mode we're running in
+    let signalId = sessionMode.connect('updated', function() {
+                                           sessionMode.disconnect(signalId);
+                                           startSession();
+                                       });
+}
+
+function startSession() {
     sessionMode.connect('updated', _loadDefaultStylesheet);
 
     shellDBusService = new ShellDBus.GnomeShell();